#ifndef SERVER_H
#define SERVER_H

#include <QObject>
#include <QTcpServer>
#include <QDebug>
#include <QHostAddress>
#include <QTcpSocket>
#include "tcpsocket.h"

class Server : public QTcpServer
{
    Q_OBJECT
public:
    Server(QObject *parent = 0, quint16 port = 9999);
    ~Server();

signals:
    void updateMsg(QByteArray datagram);

private slots:
    void slotAccept();

    //void slotReadData();

    void slotDisconnected(int socketDescrip);

    void slotUpdate(QByteArray datagram);

protected:
    void incomingConnection(qintptr socket);

private:
    QList<TcpSocket *> clients;

};

#endif // SERVER_H
